<template>
  <div class="common-layout">
    <el-container>
      <el-header style="background-color:blueviolet;">
        <span style="float: right; font-size: 35px; color: aliceblue;">欢迎您！{{ pinia.account.UserName }} <el-button type="primary" @click="Tiao">无申请</el-button> <el-button type="danger" @click="loginout">退出</el-button></span>
       
      </el-header>
      <el-container>
        <el-aside width="200px">
            <el-col :span="30">

      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="2"
        text-color="#fff"
        @open="handleOpen"
        @close="handleClose"
        router
       
      >
        
         
           <el-menu-item index="/appfrom">提交申请</el-menu-item>
           
        
      
       
       
      </el-menu>
    </el-col>
        </el-aside>
        <el-main>
            <RouterView />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
import {useCounterStore} from '@/stores/counter'
import { useRouter } from 'vue-router';
const router=useRouter();
const pinia=useCounterStore();
import {
  Menu as IconMenu,
  Location,
} from '@element-plus/icons-vue'

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const loginout=()=>{
  pinia.account.UserName=""
  pinia.account.rid=[]
  pinia.account.departmentId=''
  pinia.account.names=[],
  pinia.account.uid=''
  router.push('/')
}

const Tiao=()=>{
  router.push('/mains')
}
</script>
